package com.cms.recursoshumanos.facade;


import com.cms.recursoshumanos.constant.Constant;
import com.cms.recursoshumanos.handler.WServiceCall;
import com.cms.recursoshumanos.json.me.JSONParser;
import com.cms.recursoshumanos.json.object.JsonObjectGetHospitalFamiliar;
import com.cms.recursoshumanos.object.Poliza;

public class ListaHospitalFamiliarScreenFacade
{

	private String strUsername;
	private String strPass;
	private Poliza laPoliza;
	
	public ListaHospitalFamiliarScreenFacade(String user,
												String password,
												Poliza poliza)
	{
		this.strUsername = user;
		this.strPass = password;
		this.laPoliza = poliza;
		
	}

	
	public void getListaHospital()
	{
		enviarSolicitud( );
	}
	
	public String enviarSolicitud()
	{
		 
		JSONParser jParser = new JSONParser();
		return setValores(jParser.
						getJSONFromUrl(
								Constant.URL_WEBSERVICE, 
								WServiceCall.getInstance().getHospitalFamiliar(strUsername,
																				strPass,laPoliza.
																				getSeguro().
																				getIdSeguro())));

	}
	public String setValores(String strResult)
	{
		JsonObjectGetHospitalFamiliar.getInstance().fromJSON(strResult);
		return JsonObjectGetHospitalFamiliar.getInstance().getResult();
		
	}
	

	
}
